#!/usr/bin/env python
# -*- coding=utf8 -*-
from django.conf.urls import patterns, include, url
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
# from views import HomePageView,LoginPageView,login_view,logout_view
from views import home_page,login_page,login_view,logout_view,actions
from shapeview import all,details,charts
import manager_api_views as mg
import apiviews as api
import message_api_views as msg
from django.contrib import admin

admin.autodiscover()

urlpatterns = patterns('',
    (r'^admin/', include(admin.site.urls)),
    # url(r'^$', HomePageView.as_view()),
    (r'^$', home_page),
    (r'^actions_(\w+)/$',actions),
    (r'^accounts/login/$', login_view),
    (r'^accounts/logout/$', logout_view),
    # (r'^shape/$', all),
    (r'^chart/(?P<b_id>\d)/$', details),
    (r'^shape/charts/(?P<shape_id>\d{1,3})/$', charts),

    # (r'^queue/$', queue),
    (r'^queue/(?P<broker_id>\d{4,6})/(?P<queue_id>\d{4,6})/$', details),


    (r'^api/shape$', api.shape_all),
    (r'^api/topic$', api.topic_all),
    (r'^api/area_charts/(?P<shape_id>\d{1,3})/$', api.chart_area),
    (r'^api/cbm$', api.cluster_bid_mapping),
    (r'^api/progress$', api.get_progress_diff_data),
    (r'^manager/add_topic$', mg.add_topic),
    (r'^manager/del_topic$', mg.del_topic),
    (r'^manager/add_subgroup$', mg.add_subgroup),
    (r'^manager/del_subgroup$', mg.del_subgroup),
    (r'^manager/up_broker_cfg$', mg.up_broker_cfg),
    (r'^message/get_message_by_id$', msg.get_message_by_id),
    (r'^message/get_messages$', msg.get_messages),
)

urlpatterns += staticfiles_urlpatterns()

